package com.cloudsigns.factorymanager2.project.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.cloudsigns.factorymanager2.R;
import com.cloudsigns.factorymanager2.project.activity.DesignContactOrderActivity;
import com.cloudsigns.factorymanager2.project.activity.DesignContactOrderListActivity;
import com.cloudsigns.factorymanager2.project.activity.EngineeringOrderListActivity;
import com.cloudsigns.factorymanager2.project.activity.MaintenanceOrderListActivity;
import com.cloudsigns.factorymanager2.project.activity.ProductionOrderListActivity;

/**
 * Created by tony on 2017/12/2.
 */

public class WorkSheetListFragment extends Fragment implements View.OnClickListener {
    private LinearLayout ll_design, ll_produced, ll_engineering, ll_maintenance;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_work_sheet_list, null);
        ll_design = view.findViewById(R.id.ll_design);
        ll_produced = view.findViewById(R.id.ll_produced);
        ll_engineering = view.findViewById(R.id.ll_engineering);
        ll_maintenance = view.findViewById(R.id.ll_maintenance);


        ll_design.setOnClickListener(this);
        ll_produced.setOnClickListener(this);
        ll_engineering.setOnClickListener(this);
        ll_maintenance.setOnClickListener(this);
        return view;
    }

    @Override
    public void onClick(View view) {
        Intent mIntent;
        switch (view.getId()) {
            case R.id.ll_design:
                mIntent = new Intent(getActivity(), DesignContactOrderListActivity.class);
                startActivity(mIntent);
                break;
            case R.id.ll_produced:
                mIntent = new Intent(getActivity(), ProductionOrderListActivity.class);
                startActivity(mIntent);
                break;
            case R.id.ll_engineering:
                mIntent = new Intent(getActivity(), EngineeringOrderListActivity.class);
                startActivity(mIntent);
                break;
            case R.id.ll_maintenance:
                mIntent = new Intent(getActivity(), MaintenanceOrderListActivity.class);
                startActivity(mIntent);
                break;
        }
    }
}
